﻿@inherits BlazorStrap.Shared.Components.Common.BSAlertBase
@namespace BlazorStrap.V4


@if (IsDismissed) {return;}
<div class="@ClassBuilder" role="alert" @attributes="Attributes">
    @if (Header != null)
    {
        switch (Heading)
        {
            case 1:
                <h1 class="alert-heading">@Header</h1>
                break;
            case 2:
                <h2 class="alert-heading">@Header</h2>
                break;
            case 3:
                <h3 class="alert-heading">@Header</h3>
                break;
            case 4:
                <h4 class="alert-heading">@Header</h4>
                break;
            case 5:
                <h5 class="alert-heading">@Header</h5>
                break;
            case 6:
                <h6 class="alert-heading">@Header</h6>
                break;
        }
        @Content
    }
    else if(HasIcon)
    {
        <span class="@($"mr-{IconEndMargin.ToIndex()}")">
        @((MarkupString)(Icons.GetAlertIcon(Color.NameToLower()) ?? ""))
        </span>
        @ChildContent
    }
    else
    {
        @ChildContent
    }
    @if (IsDismissible)
    {
        <BSCloseButton @onclick="CloseEventAsync" Class="float-right" />
    }
</div>